package nowCoder;

import java.util.Scanner;

public class HJ40 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String x = in.nextLine();
        int a=0,b=0,c=0,d=0;
        for (int i = 0; i < x.length(); i++) {
            int xx = x.charAt(i);
            if (xx == 32){
                b++;
            }else if(xx >= 48 && xx <=57){
                c++;
            }else if(xx >= 65 && xx <= 90){
                a++;
            }else if(xx >= 97 && xx <= 122){
                a++;
            }else {
                d++;
            }
        }
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
    }
}
